<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class MyloveList extends FillBase
{

    
    public function obtainMyloveList($user_id, $limit, $start){
        $list =  UserFile::model()->findAllBySql("SELECT f.* FROM ".Yii::app()->params['tablePrefix']."files f, ".Yii::app()->params['tablePrefix']."file_star s where f.is_deleted = 0 and s.file_id=f.id and f.user_id = ".$user_id." order by created_at desc limit ".$start.", ".$limit);
        $data =  $this->filSearchFillList($list);
        return $data;
    }
    
    
    

    
    public function myloveCount($user_id){
        $count = UserFile::model()->countBySql("SELECT count(*) FROM ".Yii::app()->params['tablePrefix']."files f, ".Yii::app()->params['tablePrefix']."file_star s where f.is_deleted = 0 and s.file_id=f.id and s.user_id = ".$user_id);
        return $count;
    }
}
?>